package test;

import java.util.Arrays;

/*
* 字符串重载的split方法
* String[] split(String regx,int limit)*/
public class SplitDemo {
    public static void main(String[] args) {
        String line = "1=2=3=4=5=6=7============";
        String[] data = line.split("="); //[1, 2, 3, 4, 5, 6, 7]
        data = line.split("=",2);//[1, 2=3=4=5=6=7============]
        data = line.split("=",3);//[1, 2, 3=4=5=6=7============]
        data = line.split("=",100);//[1, 2, 3, 4, 5, 6, 7, , , , , , , , , , , , ]
        data = line.split("=",0);//[1, 2, 3, 4, 5, 6, 7]
        data = line.split("=",-1);//[1, 2, 3, 4, 5, 6, 7, , , , , , , , , , , , ] 应拆尽拆
        System.out.println(Arrays.toString(data));

    }
}
